package com.dahaiwuliang.code.server;

import com.dahaiwuliang.code.pojo.User;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface UserServer {
    /**
     * 根据id查找用户
     */

    User findByUserName(String userName);

    /**
     * 根据邮箱查找用户
     */

    User findByEmail(String email);

    public  void save(User user);



    User findById(Integer userId);

    /**
     * 根据条件获取用户总数
     * @param s_user  条件
     * @param s_blatelyLoginTime 最近登入时间开始
     * @param s_elatelyLoginTime 结束
     * @return
     */
    public  Long getCount(User s_user,String s_blatelyLoginTime,String s_elatelyLoginTime);


    /**
     * 今天用户注册数
     */

    Integer todayRegister();

    /**
     * 今天用户登入数
     */

    Integer todayLogin();

    /**
     * 用户注册数
     */

    Integer Register();

    /**
     *
     * @param s_user
     * @param s_blatelyLoginTimes
     * @param s_elatelyLoginTimes
     * @param page
     * @param pageSize
     * @param direction
     * @param properties
     * @return
     */
  public List<User> list(User s_user, String s_blatelyLoginTimes, String s_elatelyLoginTimes, Integer page, Integer pageSize, Sort.Direction direction, String... properties);
}
